3.102 \(\int \frac{(g+h x)^2 (d+e x+f x^2)}{\sqrt{a+c x^2}} \, dx\)

Optimal. Leaf size=223 \[ \frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) \left (3 a^2 f h^2-4 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{8 c^{5/2}}-\frac{\sqrt{a+c x^2} \left (4 \left (4 a h^2 (e h+2 f g)+c g \left (f g^2-4 h (3 d h+e g)\right )\right )-h x \left (3 h^2 (4 c d-3 a f)-2 c g (f g-4 e h)\right )\right )}{24 c^2 h}-\frac{\sqrt{a+c x^2} (g+h x)^2 (f g-4 e h)}{12 c h}+\frac{f \sqrt{a+c x^2} (g+h x)^3}{4 c h} \]

[Out]

-((f*g - 4*e*h)*(g + h*x)^2*Sqrt[a + c*x^2])/(12*c*h) + (f*(g + h*x)^3*Sqrt[a + c*x^2])/(4*c*h) - ((4*(4*a*h^2
*(2*f*g + e*h) + c*g*(f*g^2 - 4*h*(e*g + 3*d*h))) - h*(3*(4*c*d - 3*a*f)*h^2 - 2*c*g*(f*g - 4*e*h))*x)*Sqrt[a
+ c*x^2])/(24*c^2*h) + ((8*c^2*d*g^2 + 3*a^2*f*h^2 - 4*a*c*(f*g^2 + h*(2*e*g + d*h)))*ArcTanh[(Sqrt[c]*x)/Sqrt
[a + c*x^2]])/(8*c^(5/2))

________________________________________________________________________________________

Rubi [A]  time = 0.372031, antiderivative size = 222, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {1654, 833, 780, 217, 206} \[ \frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) \left (3 a^2 f h^2-4 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{8 c^{5/2}}-\frac{\sqrt{a+c x^2} \left (4 \left (4 a h^2 (e h+2 f g)-4 c g h (3 d h+e g)+c f g^3\right )-h x \left (3 h^2 (4 c d-3 a f)-2 c g (f g-4 e h)\right )\right )}{24 c^2 h}-\frac{\sqrt{a+c x^2} (g+h x)^2 (f g-4 e h)}{12 c h}+\frac{f \sqrt{a+c x^2} (g+h x)^3}{4 c h} \]

Antiderivative was successfully verified.

[In]

Int[((g + h*x)^2*(d + e*x + f*x^2))/Sqrt[a + c*x^2],x]

[Out]

-((f*g - 4*e*h)*(g + h*x)^2*Sqrt[a + c*x^2])/(12*c*h) + (f*(g + h*x)^3*Sqrt[a + c*x^2])/(4*c*h) - ((4*(c*f*g^3
 - 4*c*g*h*(e*g + 3*d*h) + 4*a*h^2*(2*f*g + e*h)) - h*(3*(4*c*d - 3*a*f)*h^2 - 2*c*g*(f*g - 4*e*h))*x)*Sqrt[a
+ c*x^2])/(24*c^2*h) + ((8*c^2*d*g^2 + 3*a^2*f*h^2 - 4*a*c*(f*g^2 + h*(2*e*g + d*h)))*ArcTanh[(Sqrt[c]*x)/Sqrt
[a + c*x^2]])/(8*c^(5/2))

Rule 1654

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Expon[Pq, x], f = Coeff
[Pq, x, Expon[Pq, x]]}, Simp[(f*(d + e*x)^(m + q - 1)*(a + c*x^2)^(p + 1))/(c*e^(q - 1)*(m + q + 2*p + 1)), x]
 + Dist[1/(c*e^q*(m + q + 2*p + 1)), Int[(d + e*x)^m*(a + c*x^2)^p*ExpandToSum[c*e^q*(m + q + 2*p + 1)*Pq - c*
f*(m + q + 2*p + 1)*(d + e*x)^q - f*(d + e*x)^(q - 2)*(a*e^2*(m + q - 1) - c*d^2*(m + q + 2*p + 1) - 2*c*d*e*(
m + q + p)*x), x], x], x] /; GtQ[q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, c, d, e, m, p}, x] && PolyQ[Pq
, x] && NeQ[c*d^2 + a*e^2, 0] &&  !(EqQ[d, 0] && True) &&  !(IGtQ[m, 0] && RationalQ[a, c, d, e] && (IntegerQ[
p] || ILtQ[p + 1/2, 0]))

Rule 833

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[(g*(d + e*x)
^m*(a + c*x^2)^(p + 1))/(c*(m + 2*p + 2)), x] + Dist[1/(c*(m + 2*p + 2)), Int[(d + e*x)^(m - 1)*(a + c*x^2)^p*
Simp[c*d*f*(m + 2*p + 2) - a*e*g*m + c*(e*f*(m + 2*p + 2) + d*g*m)*x, x], x], x] /; FreeQ[{a, c, d, e, f, g, p
}, x] && NeQ[c*d^2 + a*e^2, 0] && GtQ[m, 0] && NeQ[m + 2*p + 2, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ
[2*m, 2*p]) &&  !(IGtQ[m, 0] && EqQ[f, 0])

Rule 780

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(((e*f + d*g)*(2*p
 + 3) + 2*e*g*(p + 1)*x)*(a + c*x^2)^(p + 1))/(2*c*(p + 1)*(2*p + 3)), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(c*
(2*p + 3)), Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] &&  !LeQ[p, -1]

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt{a+c x^2}} \, dx &=\frac{f (g+h x)^3 \sqrt{a+c x^2}}{4 c h}+\frac{\int \frac{(g+h x)^2 \left ((4 c d-3 a f) h^2-c h (f g-4 e h) x\right )}{\sqrt{a+c x^2}} \, dx}{4 c h^2}\\ &=-\frac{(f g-4 e h) (g+h x)^2 \sqrt{a+c x^2}}{12 c h}+\frac{f (g+h x)^3 \sqrt{a+c x^2}}{4 c h}+\frac{\int \frac{(g+h x) \left (c h^2 (12 c d g-7 a f g-8 a e h)+c h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right )}{\sqrt{a+c x^2}} \, dx}{12 c^2 h^2}\\ &=-\frac{(f g-4 e h) (g+h x)^2 \sqrt{a+c x^2}}{12 c h}+\frac{f (g+h x)^3 \sqrt{a+c x^2}}{4 c h}-\frac{\left (4 \left (c f g^3-4 c g h (e g+3 d h)+4 a h^2 (2 f g+e h)\right )-h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right ) \sqrt{a+c x^2}}{24 c^2 h}+\frac{\left (8 c^2 d g^2+3 a^2 f h^2-4 a c \left (f g^2+h (2 e g+d h)\right )\right ) \int \frac{1}{\sqrt{a+c x^2}} \, dx}{8 c^2}\\ &=-\frac{(f g-4 e h) (g+h x)^2 \sqrt{a+c x^2}}{12 c h}+\frac{f (g+h x)^3 \sqrt{a+c x^2}}{4 c h}-\frac{\left (4 \left (c f g^3-4 c g h (e g+3 d h)+4 a h^2 (2 f g+e h)\right )-h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right ) \sqrt{a+c x^2}}{24 c^2 h}+\frac{\left (8 c^2 d g^2+3 a^2 f h^2-4 a c \left (f g^2+h (2 e g+d h)\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1-c x^2} \, dx,x,\frac{x}{\sqrt{a+c x^2}}\right )}{8 c^2}\\ &=-\frac{(f g-4 e h) (g+h x)^2 \sqrt{a+c x^2}}{12 c h}+\frac{f (g+h x)^3 \sqrt{a+c x^2}}{4 c h}-\frac{\left (4 \left (c f g^3-4 c g h (e g+3 d h)+4 a h^2 (2 f g+e h)\right )-h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right ) \sqrt{a+c x^2}}{24 c^2 h}+\frac{\left (8 c^2 d g^2+3 a^2 f h^2-4 a c \left (f g^2+h (2 e g+d h)\right )\right ) \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right )}{8 c^{5/2}}\\ \end{align*}

Mathematica [A]  time = 0.249788, size = 164, normalized size = 0.74 \[ \frac{3 \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) \left (3 a^2 f h^2-4 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )+\sqrt{c} \sqrt{a+c x^2} \left (2 c \left (6 d h (4 g+h x)+4 e \left (3 g^2+3 g h x+h^2 x^2\right )+f x \left (6 g^2+8 g h x+3 h^2 x^2\right )\right )-a h (16 e h+32 f g+9 f h x)\right )}{24 c^{5/2}} \]

Antiderivative was successfully verified.

[In]

Integrate[((g + h*x)^2*(d + e*x + f*x^2))/Sqrt[a + c*x^2],x]

[Out]

(Sqrt[c]*Sqrt[a + c*x^2]*(-(a*h*(32*f*g + 16*e*h + 9*f*h*x)) + 2*c*(6*d*h*(4*g + h*x) + 4*e*(3*g^2 + 3*g*h*x +
 h^2*x^2) + f*x*(6*g^2 + 8*g*h*x + 3*h^2*x^2))) + 3*(8*c^2*d*g^2 + 3*a^2*f*h^2 - 4*a*c*(f*g^2 + h*(2*e*g + d*h
)))*ArcTanh[(Sqrt[c]*x)/Sqrt[a + c*x^2]])/(24*c^(5/2))

________________________________________________________________________________________

Maple [A]  time = 0.061, size = 339, normalized size = 1.5 \begin{align*}{\frac{{h}^{2}f{x}^{3}}{4\,c}\sqrt{c{x}^{2}+a}}-{\frac{3\,af{h}^{2}x}{8\,{c}^{2}}\sqrt{c{x}^{2}+a}}+{\frac{3\,{a}^{2}f{h}^{2}}{8}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{5}{2}}}}+{\frac{{h}^{2}{x}^{2}e}{3\,c}\sqrt{c{x}^{2}+a}}+{\frac{2\,{x}^{2}ghf}{3\,c}\sqrt{c{x}^{2}+a}}-{\frac{2\,a{h}^{2}e}{3\,{c}^{2}}\sqrt{c{x}^{2}+a}}-{\frac{4\,aghf}{3\,{c}^{2}}\sqrt{c{x}^{2}+a}}+{\frac{dx{h}^{2}}{2\,c}\sqrt{c{x}^{2}+a}}+{\frac{egxh}{c}\sqrt{c{x}^{2}+a}}+{\frac{fx{g}^{2}}{2\,c}\sqrt{c{x}^{2}+a}}-{\frac{ad{h}^{2}}{2}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}-{aegh\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}-{\frac{af{g}^{2}}{2}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}+2\,{\frac{\sqrt{c{x}^{2}+a}ghd}{c}}+{\frac{e{g}^{2}}{c}\sqrt{c{x}^{2}+a}}+{{g}^{2}d\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){\frac{1}{\sqrt{c}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+a)^(1/2),x)

[Out]

1/4*h^2*f*x^3/c*(c*x^2+a)^(1/2)-3/8*h^2*f*a/c^2*x*(c*x^2+a)^(1/2)+3/8*h^2*f*a^2/c^(5/2)*ln(x*c^(1/2)+(c*x^2+a)
^(1/2))+1/3*x^2/c*(c*x^2+a)^(1/2)*h^2*e+2/3*x^2/c*(c*x^2+a)^(1/2)*g*h*f-2/3*a/c^2*(c*x^2+a)^(1/2)*h^2*e-4/3*a/
c^2*(c*x^2+a)^(1/2)*g*h*f+1/2*x/c*(c*x^2+a)^(1/2)*d*h^2+x/c*(c*x^2+a)^(1/2)*e*g*h+1/2*x/c*(c*x^2+a)^(1/2)*f*g^
2-1/2*a/c^(3/2)*ln(x*c^(1/2)+(c*x^2+a)^(1/2))*d*h^2-a/c^(3/2)*ln(x*c^(1/2)+(c*x^2+a)^(1/2))*e*g*h-1/2*a/c^(3/2
)*ln(x*c^(1/2)+(c*x^2+a)^(1/2))*f*g^2+2/c*(c*x^2+a)^(1/2)*g*h*d+1/c*(c*x^2+a)^(1/2)*e*g^2+g^2*d*ln(x*c^(1/2)+(
c*x^2+a)^(1/2))/c^(1/2)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+a)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.18368, size = 871, normalized size = 3.91 \begin{align*} \left [-\frac{3 \,{\left (8 \, a c e g h - 4 \,{\left (2 \, c^{2} d - a c f\right )} g^{2} +{\left (4 \, a c d - 3 \, a^{2} f\right )} h^{2}\right )} \sqrt{c} \log \left (-2 \, c x^{2} - 2 \, \sqrt{c x^{2} + a} \sqrt{c} x - a\right ) - 2 \,{\left (6 \, c^{2} f h^{2} x^{3} + 24 \, c^{2} e g^{2} - 16 \, a c e h^{2} + 16 \,{\left (3 \, c^{2} d - 2 \, a c f\right )} g h + 8 \,{\left (2 \, c^{2} f g h + c^{2} e h^{2}\right )} x^{2} + 3 \,{\left (4 \, c^{2} f g^{2} + 8 \, c^{2} e g h +{\left (4 \, c^{2} d - 3 \, a c f\right )} h^{2}\right )} x\right )} \sqrt{c x^{2} + a}}{48 \, c^{3}}, \frac{3 \,{\left (8 \, a c e g h - 4 \,{\left (2 \, c^{2} d - a c f\right )} g^{2} +{\left (4 \, a c d - 3 \, a^{2} f\right )} h^{2}\right )} \sqrt{-c} \arctan \left (\frac{\sqrt{-c} x}{\sqrt{c x^{2} + a}}\right ) +{\left (6 \, c^{2} f h^{2} x^{3} + 24 \, c^{2} e g^{2} - 16 \, a c e h^{2} + 16 \,{\left (3 \, c^{2} d - 2 \, a c f\right )} g h + 8 \,{\left (2 \, c^{2} f g h + c^{2} e h^{2}\right )} x^{2} + 3 \,{\left (4 \, c^{2} f g^{2} + 8 \, c^{2} e g h +{\left (4 \, c^{2} d - 3 \, a c f\right )} h^{2}\right )} x\right )} \sqrt{c x^{2} + a}}{24 \, c^{3}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+a)^(1/2),x, algorithm="fricas")

[Out]

[-1/48*(3*(8*a*c*e*g*h - 4*(2*c^2*d - a*c*f)*g^2 + (4*a*c*d - 3*a^2*f)*h^2)*sqrt(c)*log(-2*c*x^2 - 2*sqrt(c*x^
2 + a)*sqrt(c)*x - a) - 2*(6*c^2*f*h^2*x^3 + 24*c^2*e*g^2 - 16*a*c*e*h^2 + 16*(3*c^2*d - 2*a*c*f)*g*h + 8*(2*c
^2*f*g*h + c^2*e*h^2)*x^2 + 3*(4*c^2*f*g^2 + 8*c^2*e*g*h + (4*c^2*d - 3*a*c*f)*h^2)*x)*sqrt(c*x^2 + a))/c^3, 1
/24*(3*(8*a*c*e*g*h - 4*(2*c^2*d - a*c*f)*g^2 + (4*a*c*d - 3*a^2*f)*h^2)*sqrt(-c)*arctan(sqrt(-c)*x/sqrt(c*x^2
 + a)) + (6*c^2*f*h^2*x^3 + 24*c^2*e*g^2 - 16*a*c*e*h^2 + 16*(3*c^2*d - 2*a*c*f)*g*h + 8*(2*c^2*f*g*h + c^2*e*
h^2)*x^2 + 3*(4*c^2*f*g^2 + 8*c^2*e*g*h + (4*c^2*d - 3*a*c*f)*h^2)*x)*sqrt(c*x^2 + a))/c^3]

________________________________________________________________________________________

Sympy [A]  time = 13.7865, size = 518, normalized size = 2.32 \begin{align*} - \frac{3 a^{\frac{3}{2}} f h^{2} x}{8 c^{2} \sqrt{1 + \frac{c x^{2}}{a}}} + \frac{\sqrt{a} d h^{2} x \sqrt{1 + \frac{c x^{2}}{a}}}{2 c} + \frac{\sqrt{a} e g h x \sqrt{1 + \frac{c x^{2}}{a}}}{c} + \frac{\sqrt{a} f g^{2} x \sqrt{1 + \frac{c x^{2}}{a}}}{2 c} - \frac{\sqrt{a} f h^{2} x^{3}}{8 c \sqrt{1 + \frac{c x^{2}}{a}}} + \frac{3 a^{2} f h^{2} \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{8 c^{\frac{5}{2}}} - \frac{a d h^{2} \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{2 c^{\frac{3}{2}}} - \frac{a e g h \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{c^{\frac{3}{2}}} - \frac{a f g^{2} \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{2 c^{\frac{3}{2}}} + d g^{2} \left (\begin{cases} \frac{\sqrt{- \frac{a}{c}} \operatorname{asin}{\left (x \sqrt{- \frac{c}{a}} \right )}}{\sqrt{a}} & \text{for}\: a > 0 \wedge c < 0 \\\frac{\sqrt{\frac{a}{c}} \operatorname{asinh}{\left (x \sqrt{\frac{c}{a}} \right )}}{\sqrt{a}} & \text{for}\: a > 0 \wedge c > 0 \\\frac{\sqrt{- \frac{a}{c}} \operatorname{acosh}{\left (x \sqrt{- \frac{c}{a}} \right )}}{\sqrt{- a}} & \text{for}\: c > 0 \wedge a < 0 \end{cases}\right ) + 2 d g h \left (\begin{cases} \frac{x^{2}}{2 \sqrt{a}} & \text{for}\: c = 0 \\\frac{\sqrt{a + c x^{2}}}{c} & \text{otherwise} \end{cases}\right ) + e g^{2} \left (\begin{cases} \frac{x^{2}}{2 \sqrt{a}} & \text{for}\: c = 0 \\\frac{\sqrt{a + c x^{2}}}{c} & \text{otherwise} \end{cases}\right ) + e h^{2} \left (\begin{cases} - \frac{2 a \sqrt{a + c x^{2}}}{3 c^{2}} + \frac{x^{2} \sqrt{a + c x^{2}}}{3 c} & \text{for}\: c \neq 0 \\\frac{x^{4}}{4 \sqrt{a}} & \text{otherwise} \end{cases}\right ) + 2 f g h \left (\begin{cases} - \frac{2 a \sqrt{a + c x^{2}}}{3 c^{2}} + \frac{x^{2} \sqrt{a + c x^{2}}}{3 c} & \text{for}\: c \neq 0 \\\frac{x^{4}}{4 \sqrt{a}} & \text{otherwise} \end{cases}\right ) + \frac{f h^{2} x^{5}}{4 \sqrt{a} \sqrt{1 + \frac{c x^{2}}{a}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)**2*(f*x**2+e*x+d)/(c*x**2+a)**(1/2),x)

[Out]

-3*a**(3/2)*f*h**2*x/(8*c**2*sqrt(1 + c*x**2/a)) + sqrt(a)*d*h**2*x*sqrt(1 + c*x**2/a)/(2*c) + sqrt(a)*e*g*h*x
*sqrt(1 + c*x**2/a)/c + sqrt(a)*f*g**2*x*sqrt(1 + c*x**2/a)/(2*c) - sqrt(a)*f*h**2*x**3/(8*c*sqrt(1 + c*x**2/a
)) + 3*a**2*f*h**2*asinh(sqrt(c)*x/sqrt(a))/(8*c**(5/2)) - a*d*h**2*asinh(sqrt(c)*x/sqrt(a))/(2*c**(3/2)) - a*
e*g*h*asinh(sqrt(c)*x/sqrt(a))/c**(3/2) - a*f*g**2*asinh(sqrt(c)*x/sqrt(a))/(2*c**(3/2)) + d*g**2*Piecewise((s
qrt(-a/c)*asin(x*sqrt(-c/a))/sqrt(a), (a > 0) & (c < 0)), (sqrt(a/c)*asinh(x*sqrt(c/a))/sqrt(a), (a > 0) & (c
> 0)), (sqrt(-a/c)*acosh(x*sqrt(-c/a))/sqrt(-a), (c > 0) & (a < 0))) + 2*d*g*h*Piecewise((x**2/(2*sqrt(a)), Eq
(c, 0)), (sqrt(a + c*x**2)/c, True)) + e*g**2*Piecewise((x**2/(2*sqrt(a)), Eq(c, 0)), (sqrt(a + c*x**2)/c, Tru
e)) + e*h**2*Piecewise((-2*a*sqrt(a + c*x**2)/(3*c**2) + x**2*sqrt(a + c*x**2)/(3*c), Ne(c, 0)), (x**4/(4*sqrt
(a)), True)) + 2*f*g*h*Piecewise((-2*a*sqrt(a + c*x**2)/(3*c**2) + x**2*sqrt(a + c*x**2)/(3*c), Ne(c, 0)), (x*
*4/(4*sqrt(a)), True)) + f*h**2*x**5/(4*sqrt(a)*sqrt(1 + c*x**2/a))

________________________________________________________________________________________

Giac [A]  time = 1.17298, size = 278, normalized size = 1.25 \begin{align*} \frac{1}{24} \, \sqrt{c x^{2} + a}{\left ({\left (2 \,{\left (\frac{3 \, f h^{2} x}{c} + \frac{4 \,{\left (2 \, c^{3} f g h + c^{3} h^{2} e\right )}}{c^{4}}\right )} x + \frac{3 \,{\left (4 \, c^{3} f g^{2} + 4 \, c^{3} d h^{2} - 3 \, a c^{2} f h^{2} + 8 \, c^{3} g h e\right )}}{c^{4}}\right )} x + \frac{8 \,{\left (6 \, c^{3} d g h - 4 \, a c^{2} f g h + 3 \, c^{3} g^{2} e - 2 \, a c^{2} h^{2} e\right )}}{c^{4}}\right )} - \frac{{\left (8 \, c^{2} d g^{2} - 4 \, a c f g^{2} - 4 \, a c d h^{2} + 3 \, a^{2} f h^{2} - 8 \, a c g h e\right )} \log \left ({\left | -\sqrt{c} x + \sqrt{c x^{2} + a} \right |}\right )}{8 \, c^{\frac{5}{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((h*x+g)^2*(f*x^2+e*x+d)/(c*x^2+a)^(1/2),x, algorithm="giac")

[Out]

1/24*sqrt(c*x^2 + a)*((2*(3*f*h^2*x/c + 4*(2*c^3*f*g*h + c^3*h^2*e)/c^4)*x + 3*(4*c^3*f*g^2 + 4*c^3*d*h^2 - 3*
a*c^2*f*h^2 + 8*c^3*g*h*e)/c^4)*x + 8*(6*c^3*d*g*h - 4*a*c^2*f*g*h + 3*c^3*g^2*e - 2*a*c^2*h^2*e)/c^4) - 1/8*(
8*c^2*d*g^2 - 4*a*c*f*g^2 - 4*a*c*d*h^2 + 3*a^2*f*h^2 - 8*a*c*g*h*e)*log(abs(-sqrt(c)*x + sqrt(c*x^2 + a)))/c^
(5/2)